package com.dr.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dr.entity.Producttype;
import com.dr.mapper.ProducttypeMapper;
import com.dr.service.ProducttypeService;

@Service // bean
@Transactional // 事务
public class ProducttypeServiceImpl implements ProducttypeService {
	// 注入mapper
	@Autowired
	private ProducttypeMapper producttypeMapper;

	@Override
	public List<Producttype> findAll() {
		// TODO Auto-generated method stub
		return producttypeMapper.findAll();
	}

	@Override
	public List<Producttype> findOneLevel() {
		// TODO Auto-generated method stub
		return producttypeMapper.findOneLevel();
	}

	@Override
	public int findIsHvaeSon(int id) {
		// TODO Auto-generated method stub
		return producttypeMapper.findIsHvaeSon(id);
	}

	@Override
	public int findIsHaveProduct(int id) {
		// TODO Auto-generated method stub
		return producttypeMapper.findIsHaveProduct(id);
	}

	@Override
	public int insert(Producttype producttype) {
		// TODO Auto-generated method stub
		return producttypeMapper.insert(producttype);
	}

	@Override
	public int delete(int id) {
		// TODO Auto-generated method stub
		return producttypeMapper.delete(id);
	}

	@Override
	public int update(Producttype producttype) {
		// TODO Auto-generated method stub
		return producttypeMapper.update(producttype);
	}

	@Override
	public List<Producttype> findSonByid(int id) {
		// TODO Auto-generated method stub
		return producttypeMapper.findSonByid(id);
	}
	
	

}
